package com.woniu.adapter;

import com.woniu.outlet.mysql.SellRecordDao;
import com.woniu.outlet.mysql.po.SellRecordSQL;
import com.woniu.service.bean.AddSellRecord;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SellRecordAdapter {

    @Autowired
    private SellRecordDao sellRecordDao;

    /**
     * 向用户卖出记录表添加数据
     * @param addSellRecord
     */
    public void addSellRecord(AddSellRecord addSellRecord){
        SellRecordSQL sellRecordSQL = new SellRecordSQL();
        BeanUtils.copyProperties(addSellRecord,sellRecordSQL);
        sellRecordDao.insertSelective(sellRecordSQL);
    }
}
